<template>
    <div class="button-container" :style="`justify-content: ${flex};`" v-if="submitBtnVisible">
        <button class="c-button c-button--gooey" @click="buttonHandle">{{ text }}
            <div class="c-button__blobs">
                <div></div>
                <div></div>
                <div></div>
            </div>
        </button>
        <svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="display: block; height: 0; width: 0;">
            <defs>
                <filter id="goo">
                <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur"></feGaussianBlur>
                <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" result="goo"></feColorMatrix>
                <feBlend in="SourceGraphic" in2="goo"></feBlend>
                </filter>
            </defs>
        </svg>
    </div>
</template>

<script setup>
const props = defineProps({
    // 按钮显示控制
    submitBtnVisible: {
        type: Boolean,
        default: true
    },
    // 按钮文本
    text: {
        type: String,
        default: '提交'
    },
    // 位置
    flex: {
        type: String,
        default: 'center'
    }
});

const emit = defineEmits(['buttonHandle']);
function buttonHandle() {
    emit('buttonHandle')
}
</script>

<style lang="scss" scoped>
    @import './submit-button.scss';
</style>